# Copyright (C) Nicola Bizzoca   2006/2007  <hannibal_smith@users.sourceforge.net>
# Copyright (C) Simone Economo   2006/2007  <ekoes@users.sourceforge.net>
# 
#    This file is part of Absynth-FTP.
#
#    Absynth-FTP is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 3 of the License, or
#    (at your option) any later version.
#
#    Absynth-FTP is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import gtk

class newSuite:
    
    def __init__(self, function):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        if callable(function): 
            object = function()
        
        self.window.set_default_size(800, 60)
        self.window.add(object.widget)
        self.window.show_all()
        self.connectEvents({
             "delete_event" : self.delete,
             "destroy": self.destroy,
        })
    
    def connectEvents(self, events):
        for type,callback in events.items():
            self.window.connect(type, callback)

    def delete(self, widget, event, data = None):
        return False

    def destroy(self, widget, data = None):
        gtk.main_quit()
        
    def runTest(self):
        gtk.main()